cmake_minimum_required(VERSION 3.0)
project(ijkplayer)



SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pg")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")

add_definitions(-D__OS_Linux__)

INCLUDE_DIRECTORIES(
        "./"
        "./src"
        "./ijksdl"
        "./fake"
        "./libffmpeg"
        "./ijkplayer"
        "./ijksoundtouch"
        "./ijkyuv"
        "/usr/include/SDL2"
)

LINK_DIRECTORIES("./libffmpeg/install/lib")




# FILE(GLOB_RECURSE playerc "./ijkplayer/*.c")
# FILE(GLOB_RECURSE playercpp "./ijkplayer/*.cpp")
# FILE(GLOB_RECURSE sdlc "./ijksdl/*.c")
# FILE(GLOB_RECURSE mainc "./src/*.c")

set(playersrc     ./ijkplayer/ijkplayer.c /
                ./ijkplayer/ff_ffpipeline.c /
                ./ijkplayer/ff_cmdutils.c  /
                ./ijkplayer/ff_ffpipenode.c    /
                ./ijkplayer/ff_ffplay.c        /
                ./ijkplayer/ijkmeta.c  /
                ./ijkplayer/ijkavformat/allformats.c        /
                ./ijkplayer/ijkavformat/cJSON.c        /
                ./ijkplayer/ijkavformat/ijkasync.c        /
                ./ijkplayer/ijkavformat/ijkioapplication.c        /
                ./ijkplayer/ijkavformat/ijkio.c        /
                ./ijkplayer/ijkavformat/ijkiocache.c        /
                ./ijkplayer/ijkavformat/ijkioffio.c        /
                ./ijkplayer/ijkavformat/ijkiomanager.c        /
                ./ijkplayer/ijkavformat/ijkioprotocol.c        /
                ./ijkplayer/ijkavformat/ijkiourlhook.c        /
                ./ijkplayer/ijkavformat/ijklas.c        /
                ./ijkplayer/ijkavformat/ijklivehook.c        /
                ./ijkplayer/ijkavformat/ijklongurl.c        /
                ./ijkplayer/ijkavformat/ijkmediadatasource.c        /
                ./ijkplayer/ijkavformat/ijksegment.c        /
                ./ijkplayer/ijkavformat/ijkurlhook.c        /
                ./ijkplayer/ijkavutil/ijkdict.c        /
                ./ijkplayer/ijkavutil/ijkfifo.c        /
                ./ijkplayer/ijkavutil/ijkstl.cpp        /
                ./ijkplayer/ijkavutil/ijkthreadpool.c        /
                ./ijkplayer/ijkavutil/ijktree.c        /
                ./ijkplayer/ijkavutil/ijkutils.c        /
                ./ijkplayer/pipeline/ffpipeline_ffplay.c        /
                ./ijkplayer/pipeline/ffpipenode_ffplay_vdec.c        /
                )
set(ijksdlsrc      ./ijksdl/ijksdl_aout.c        /
                ./ijksdl/ijksdl_timer.c        /
                ./ijksdl/ijksdl_vout.c        /
                ./ijksdl/ffmpeg/ijksdl_vout_overlay_ffmpeg.c        /
                ./ijksdl/ffmpeg/abi_all/image_convert.c        /
                ./ijksdl/linux/ijksdl_aout_SDL_audio.c        /
                ./ijksdl/linux/ijksdl_vout_SDL_surface.c        /
                ./ijksdl/linux/ijksdl_vout_SDL_window.c        /
                )
set(mainc ./src/main.c)
set(utilc ./util/dump_pts.c)


ADD_EXECUTABLE(${PROJECT_NAME}  ${mainc} ${playersrc}  ${ijksdlsrc} ${utilc})




TARGET_LINK_LIBRARIES(${PROJECT_NAME} pthread avutil avformat swresample avcodec swscale avdevice avfilter  avdevice
        m dl rt m bsd
        libSDL2.a libSDL2main.a  X11 Xext asound  pulse Xcursor  Xinerama Xi Xrandr Xss Xxf86vm wayland-egl wayland-client
        wayland-cursor xkbcommon)






